package com.ruyuan.process.engine.demo.springboot.processor;


import com.ruyuan.process.engine.process.DynamicProcessor;
import com.ruyuan.process.engine.process.ProcessContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

/**
 * @author zhonghuashishan
 * @version 1.0
 */
@Component
public class DynamicProcessorDemo extends DynamicProcessor {

    @Override
    protected void processInternal(ProcessContext context) {
        System.out.println("DynamicProcess " + context.get("id"));
        // 本节点做了一些运行调动之后，对于下一个节点运算有帮助的数据都应该放到ProcessContext里面去
    }

    @Override
    protected String nextNodeId(ProcessContext context) {
        return "node4";
    }
    // 可以从上下文里提取出来一些数据，本节点运算的结果，帮助自己计算下一个节点是谁
}

